package com.kehongborui.spring.entity;

import java.util.Calendar;
import java.util.Date;

/**
 * @author zhang peng yang ming
 * @CopyRight (C) http://www.csdn.com
 * @brief 演示spring调用类的静态工厂方法定义 bean
 * @email 122162005@qq.com
 * @date 2018-07-30
 */
public class StaticFactoryMethodDemo {
    private static StaticFactoryMethodDemo factoryMethodDemo = new StaticFactoryMethodDemo();

    private StaticFactoryMethodDemo() {}

    public static StaticFactoryMethodDemo getInstance() {
        return factoryMethodDemo;
    }

    /**
     *
     * @return
     */
    public Date getDate() {
        Calendar.getInstance().getTime();
        return new Date();
    }

    public static Date getDateInstance() {
        return new Date();
    }
}
